﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MISAPP.MISInterface;

public partial class View_WMG_WMG003_1 : ViewMatrix
{
    string caption = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = "定期性存款存續率分析";
        criteriaList = new string[] { "Criteria" };
        serviceName = "MISAPP.Classify.Service.Service_WMG003";
        List<iSelectList> CriteriaList = Session["Criteria"] as List<iSelectList>;
        iSelectList selectYM = CriteriaList[0] as iSelectList;
        string[] yms = selectYM.GetListArray();
        caption = string.Format(" {0} 定期性存款續存率分析"
            , Utility.GetTaiwanYM(yms[0]));
        

        if (!IsPostBack)
        {
            getData();
        }
    }

    protected void getData()
    {
        System.Data.DataTable dt = GetDataFromSerevice("GetSummaryData");
        CLB_Summary.Caption = caption; //"99年6月定期性存款續存率分析";
        CLB_Summary.SetData(dt, new string[] { });
    }

    protected void btn2Excel_Click(object sender, EventArgs e)
    {
        serviceName = "MISAPP.Classify.Service.Service_WMG002";
        criteriaList = new string[] { "Criteria" };

        FillToSession();

        string pageParameter;
        pageParameter = string.Format(
            "method=GetSummaryData&xls=WMG003&service=Service_WMG003&caption={0}&captionRight={1}&toHtmlMethod={2}"
            , caption, string.Empty, string.Empty);


        btn2Excel.PreviousPage = "../GV2XLS.aspx";
        btn2Excel.PageParameter = pageParameter;
    }

}
